package a.f.l;

import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.k;
import a.c.m;
import a.c.w;
import a.f.o;
import a.f.r;
import a.f.*;
import a.i.y;

import java.awt.geom.Rectangle2D;
import java.util.HashSet;

import a.i.y;

public class l
  extends r
{
  private int g = 200;
  public static boolean h;
  
  public l(rc paramrc)
  {
    a(paramrc);
  }
  
  public boolean canLayout(o paramo)
  {
    return a().canLayout(paramo);
  }
  
  public void doLayout(o paramo)
  {
    int j = g.Cc;
    int i = g.Bc;
    g localg = c();
    if (localg == null) {
      throw new IllegalStateException("No OrthogonalEdgeRouter in coreLayouter");
    }
    if ((j != 0) || (!a(paramo, localg)))
    {
      a().doLayout(paramo);
      return;
    }
    bb localbb = new bb();
    Object localObject2;
    if (j == 0) {
      if (localg.G() == 4)
      {
        if (j != 0) {
          break label327;
        }
        localObject1 = paramo.c(localg.b());
        if (localObject1 == null) {
          break label326;
        }
        localObject2 = paramo.v();
        label213:
        label215:
        do
        {
          do
          {
            if (!((w)localObject2).e()) {
              break label326;
            }
            if ((j != 0) || (((k)localObject1).getBool(((w)localObject2).d())))
            {
              localbb.add(((w)localObject2).d());
              w localw = ((w)localObject2).d().o();
              do
              {
                if (!localw.e()) {
                  break;
                }
                localbb.add(localw.d());
                localw.f();
                if (j != 0) {
                  break label215;
                }
                if (i != 0) {
                  break label213;
                }
              } while (i == 0);
            }
          } while (j != 0);
          ((w)localObject2).f();
        } while (i == 0);
      }
    }
    if (localg.G() == 2)
    {
      if (j != 0) {
        break label327;
      }
      localObject1 = paramo.c(localg.c());
      if (localObject1 != null)
      {
        localObject2 = paramo.w();
        do
        {
          if (!((m)localObject2).e()) {
            break;
          }
          if (j == 0)
          {
            if (((k)localObject1).getBool(((m)localObject2).a()))
            {
              localbb.add(((m)localObject2).a().e());
              localbb.add(((m)localObject2).a().f());
            }
            ((m)localObject2).f();
          }
        } while (i == 0);
      }
    }
    label326:
    label327:
    Object localObject1 = wc.a(paramo, localbb.l());
    double d = Math.max(5 * localg.K(), 50);
    ((Rectangle2D)localObject1).setFrame(((Rectangle2D)localObject1).getX() - d, ((Rectangle2D)localObject1).getY() - d, ((Rectangle2D)localObject1).getWidth() + 2.0D * d, ((Rectangle2D)localObject1).getHeight() + 2.0D * d);
    y localy = new y(paramo);
    HashSet localHashSet = new HashSet();
    Object localObject3 = paramo.w();
    label503:
    do
    {
      if (!((m)localObject3).e()) {
        break;
      }
      localObject4 = ((m)localObject3).a();
      if (i != 0) {
        break label516;
      }
      if (j == 0)
      {
        if (wc.a(paramo, (d)localObject4, (Rectangle2D)localObject1))
        {
          localHashSet.add(((d)localObject4).e());
          localHashSet.add(((d)localObject4).f());
        }
      }
      else
      {
        if (j != 0) {
          continue;
        }
        if (i == 0) {
          break label503;
        }
      }
      localy.a((d)localObject4);
      ((m)localObject3).f();
    } while (i == 0);
    label516:
    localObject3 = paramo.v();
    do
    {
      if (!((w)localObject3).e()) {
        break;
      }
      if (j != 0) {
        break label639;
      }
      localObject4 = ((w)localObject3).d();
      if (i != 0) {
        break label636;
      }
      localObject5 = paramo.k((e)localObject4);
      if (j == 0)
      {
        if (!((Rectangle2D)localObject1).intersects(((zc)localObject5).a(), ((zc)localObject5).b(), ((zc)localObject5).c(), ((zc)localObject5).d()))
        {
          if (j != 0) {
            continue;
          }
          if (!localHashSet.contains(localObject4)) {
            localy.a((e)localObject4);
          }
        }
        ((w)localObject3).f();
      }
    } while (i == 0);
    label636:
    label639:
    localObject3 = paramo.i();
    paramo.b((e)localObject3, 10.0D, 20.0D + ((Rectangle2D)localObject1).getHeight());
    paramo.c((e)localObject3, ((Rectangle2D)localObject1).getX() - 10.0D, ((Rectangle2D)localObject1).getY() - 10.0D);
    Object localObject4 = paramo.i();
    paramo.b((e)localObject4, 10.0D, 20.0D + ((Rectangle2D)localObject1).getHeight());
    paramo.c((e)localObject4, ((Rectangle2D)localObject1).getX() + ((Rectangle2D)localObject1).getWidth(), ((Rectangle2D)localObject1).getY() - 10.0D);
    Object localObject5 = paramo.i();
    paramo.b((e)localObject5, 20.0D + ((Rectangle2D)localObject1).getWidth(), 10.0D);
    paramo.c((e)localObject5, ((Rectangle2D)localObject1).getX() - 10.0D, ((Rectangle2D)localObject1).getY() - 10.0D);
    e locale = paramo.i();
    paramo.b(locale, 20.0D + ((Rectangle2D)localObject1).getWidth(), 10.0D);
    paramo.c(locale, ((Rectangle2D)localObject1).getX() - 10.0D, ((Rectangle2D)localObject1).getY() + ((Rectangle2D)localObject1).getHeight());
    a().doLayout(paramo);
    paramo.a((e)localObject3);
    paramo.a((e)localObject4);
    paramo.a((e)localObject5);
    paramo.a(locale);
    localy.g();
  }
  
  public void a(int paramInt)
  {
    this.g = paramInt;
  }
  
  public int b()
  {
    return this.g;
  }
  
  g c()
  {
    int j = g.Cc;
    int i = g.Bc;
    do
    {
      rc localrc = a();
      while (i == 0)
      {
        if (!(localrc instanceof vc)) {
          break;
        }
        if (j == 0)
        {
          if ((localrc instanceof g)) {
            return (g)localrc;
          }
          localrc = ((vc)localrc).a();
        }
      }
    } while (j != 0);
    return null;
  }
  
  boolean a(o paramo, g paramg)
  {
    int i = g.Cc;
    if (i == 0) {
      if (paramg.G() == 0) {
        return false;
      }
    }
    if (i == 0) {
      if (paramo.j() + paramo.l() < b()) {
        return false;
      }
    }
    return true;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.l

 * JD-Core Version:    0.7.0.1

 */